<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理</title>
    <link rel="stylesheet" href="../layui/css/layui.css">
    <link rel="stylesheet" href="../css/admin.css">
</head>

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header header">
            <a href="index.html">
                <div class="layui-logo logo">后台管理
                </div>
            </a>
            <!-- 头部区域（可配合layui已有的水平导航） -->

            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item diy-nav">
                    <a href="javascript:;">
                        <img src="http://t.cn/RCzsdCq" class="layui-nav-img"> 贤心
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="basic.html">基本资料</a></dd>
                        <dd><a href="modifypwd.html">安全设置</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item diy-nav"><a href="">注销</a></li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree layui-bg-black" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed ">
                        <a class="" href="javascript:;"><i class="layui-icon layui-icon-user"> </i>用户</a>
                        <dl class="layui-nav-child">
                            <dd><a class="tabs" href="userManage.html" data-id="33">用户管理</a></dd>
                            <dd><a class="tabs" href="adminManage.html">管理员管理</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item ">
                        <a href="javascript:;"><i class="layui-icon layui-icon-set-sm"> </i>设置</a>
                        <dl class="layui-nav-child">
                            <dd><a href="setting.html">网站设置</a></dd>
                            <dd><a href="link.html">友情链接</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item"><a href="#"><i class="layui-icon layui-icon-about"> </i>内容管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="type.html">分类管理</a></dd>
                            <dd><a href="list.html">帖子列表</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 20px; background-color: #F2F2F2;">
                <div class="layui-row layui-col-space12">
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">用户统计
                                <span class="layui-badge layui-bg-red layui-layout-right">总</span>

                            </div>
                            <div class="layui-card-body">
                                <p class="cardInfo">100</p>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">帖子统计
                                <span class="layui-badge layui-bg-blue layui-layout-right">总</span>
                            </div>
                            <div class="layui-card-body">
                                <p class="cardInfo">12</p>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-card">
                            <div class="layui-card-header">新注册用户
                                <span class="layui-badge layui-bg-green layui-layout-right">新</span>

                            </div>
                            <div class="layui-card-body">
                                <p class="cardInfo">test</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row layui-col-space12">
                <div class="layui-col-md4">
                    <div class="layui-card">
                        <div class="layui-card-header">本周活跃用户</div>
                        <div class="layui-card-body">
                            <table class="layui-hide" id="activeUser"></table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-card">
                        <div class="layui-card-header">登录日志</div>
                        <div class="layui-card-body">
                            <table class="layui-hide" id="loginLog"></table>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md4">
                    <div class="layui-card">
                        <div class="layui-card-header"> 您的资料</div>
                        <div class="layui-card-body">
                            <table class="layui-table">
                                <tr>
                                    <td>用户名</td>
                                    <td>admin</td>
                                </tr>
                                <tr>
                                    <td>上次登录时间</td>
                                    <td>2018-01-01 12:00:00</td>
                                </tr>
                                <tr>
                                    <td>上次登录IP</td>
                                    <td>101.81.80.120</td>
                                </tr>
                                <tr>
                                    <td>本次登录时间</td>
                                    <td>2018-09-01 08:09:01</td>
                                </tr>
                                <tr>
                                    <td>本次登录IP</td>
                                    <td>127.0.0.1</td>
                                </tr>
                                <tr>
                                    <td>登录次数</td>
                                    <td>5</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="layui-footer">
            <!-- 底部固定区域 -->
            © layui.com - 底部固定区域
        </div>
    </div>
    <script src="../layui/layui.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <style>
        .cardInfo {
            font-size: 36px;
            color: #666;
            line-height: 36px;
            padding: 5px 0 10px;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: break-all;
            white-space: nowrap;
        }
    </style>
    <script>
        //JavaScript代码区域
        layui.use(['element', 'table'], function() {
            var element = layui.element;
            var table = layui.table;
            table.render({
                elem: "#activeUser",
                url: '',
                cols: [
                    [{
                        field: 'name',
                        width: 80,
                        title: '用户名'
                    }, {
                        field: 'time',
                        width: 180,
                        title: '最后登录时间'
                    }, {
                        field: 'ip',
                        width: 120,
                        title: "IP地址"
                    }, {
                        field: 'count',
                        width: 80,
                        title: "文章数"
                    }]
                ]
            });
            table.render({
                elem: '#loginLog',
                url: '',
                page: true,
                cols: [
                    [{
                        field: 'name',
                        width: 100,
                        title: '用户名'
                    }, {
                        field: 'time',
                        width: 120,
                        title: '上次登录时间'
                    }, {
                        field: 'ip',
                        width: 120,
                        title: 'IP'
                    }, {
                        field: 'status',
                        width: 120,
                        title: '登录状态'
                    }]
                ]
            });

        });
    </script>
</body>

</html>